package tool;

/**
 * @Author zzz
 * @Date 2022/1/4 11:05
 * @Version 1.0
 */
public class NodePrint {
    public static void print(ListNode head){
        if (head == null){
            System.out.println("head is null!");
        }else {
            while (head!=null){
                System.out.print(head.val+"---->");
                head = head.next;
            }
            System.out.println("null\n");
        }
    }
}
